package com.common.base;

import java.util.Map;
import java.util.Set;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * 基础Controller
 * 
 * @author lujun.chen
 * @version [版本号, 2015年12月30日]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
public class BaseController {

	/***
	 * 页面跳转
	 * 
	 * @return
	 * @see [类、类#方法、类#成员]
	 */
	@RequestMapping("gotoPage")
	public ModelAndView gotoPage(HttpServletRequest request, String pageName) {
		ModelAndView mov = new ModelAndView();

		Map<String, String[]> map = request.getParameterMap();
		Set<String> keysets = map.keySet();
		for (String key : keysets) {
			String paramV = map.get(key)[0];
			mov.addObject(key, paramV);
		}

		mov.setViewName(pageName);
		return mov;
	}

}
